package com.htiiot.status.hdfs;

import org.apache.log4j.Logger;

import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;

public class LocalWriter extends HTWriter {

	private static Logger logger = Logger.getLogger(FileWriter.class);
	private File file;

	public LocalWriter(long tID, String host, long time) throws IOException {
		super(tID,host, time);
		file = new File(filePath);
		if (!file.exists()) {
			createFile(file, false);
		}

		os = new FileOutputStream(file);
	}

	public void flush() {
		try {
			os.flush();
		} catch (IOException e) {
			logger.error(e);
		}
	}

}
